<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- 开发环境版本，包含了有帮助的命令行警告 -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
    {{num}}
    <button v-on:click="increment">增加</button>
    <button v-on:click="decrement">减少</button>
</div>
<script type="text/javascript">
    var app = new Vue({
        el:"#app",
        data:{
            num:0,

        },
        methods:{
            decrement(){
                this.num--;
            },
            increment(){
                this.num++
            }
        },
        created() {
            console.log("created hook")
        },
    });
</script>
</body>
</html>